/**
 * 设置、获取、删除本地存储数据
 */
export const setStore = (name, content) => {
	if (!name) return;
	if (typeof content !== "string") {
		content = JSON.stringify(content);
	}
	uni.setStorageSync(name, content);
};

export const getStore = name => {
	if (!name) return;
	let content = uni.getStorageSync(name);
	try {
		content = JSON.parse(content);
		return content;
	} catch (e) {
		return content;
	}
}

export const removeStore = name => {
	if (!name) return;
	uni.removeStorageSync(name);
}